package org.seedltd.upms.mapper.detection;

import java.util.Set;

import org.apache.ibatis.annotations.*;
import org.seedltd.core.base.IBaseMapper;
import org.seedltd.upms.model.detection.entity.DetectionProduct;

/**
 * 产品管理数据库访问接口
 */
public interface DetectionProductMapper extends IBaseMapper<DetectionProduct> {
    @Select("select detail from detection_product_detail where product_id =#{productId}")
    String getDetailByProductId(@Param("productId") Long productId);

    @Insert("INSERT INTO detection_product_detail (`product_id`, `detail`) VALUES (#{productId}, #{detail})")
    int addDetailByProductId(@Param("productId") Long productId, @Param("detail") String detail);

    @Update("UPDATE detection_product_detail SET `detail` = #{detail} WHERE `product_id` = #{productId}")
    int updateDetailByProductId(@Param("productId") Long productId, @Param("detail") String detail);

    @Delete("delete from detection_product_detail where `product_id` = #{productId}")
    int removeDetailByProductId(@Param("productId") Long productId);

    Set<Long> selectIdByProductName(String productNames);
}
